import requestProxy from '@/utils/request';

const { request } = requestProxy;

// 申请原件tab列表
export function getOriginalTab(params) {
  return request({
    url: '/admin/original/tab',
    method: 'get',
    params
  });
}

// 申请原件列表
export function getOriginal(params, cancelToken) {
  return request({
    url: '/admin/original/list',
    method: 'get',
    params,
    cancelToken
  });
}
// 新建申请原件
export function originalCreate(data) {
  return request({
    url: '/admin/original/create',
    method: 'post',
    data
  });
}
// 编辑申请原件
export function originalEdit(id, data) {
  return request({
    url: `/admin/original/edit/${id}`,
    method: 'put',
    data
  });
}
// 删除申请原件列表元素
export function deleteOriginal(id) {
  return request({
    url: `/admin/original/delete/${id}`,
    method: 'delete'
  });
}
// 获取申请原件详情信息
export function originalInfo(id) {
  return request({
    url: `admin/original/detail/${id}`,
    method: 'get'
  });
}
// 评论列表
export function getoriginalComments(params) {
  return request({
    url: '/admin/original/comments/list',
    method: 'get',
    params
  });
}
// 发表评论
export function originalCommentAdd(data) {
  return request({
    url: '/admin/original/comments/add',
    method: 'post',
    data
  });
}
// 申请原件-流程审批
export function originalProcessAudit(data) {
  return request({
    url: '/admin/original/process/audit',
    method: 'post',
    data
  });
}
// 申请原件 - 流程 - 撤回
export function originalProcessRecall(data) {
  return request({
    url: '/admin/original/process/recall',
    method: 'post',
    data
  });
}
// 申请原件 - 流程 - 撤销
export function originalProcessRevocation(data) {
  return request({
    url: '/admin/original/process/revocation',
    method: 'post',
    data
  });
}
// 表单提交、获取审批流
export function formSubmit(data) {
  return request({
    url: '/admin/original/formSubmit',
    method: 'post',
    data
  });
}
// 获取合同文件列表
export function getFileList(params) {
  return request({
    url: '/admin/original/fileList',
    method: 'get',
    params
  });
}
